The ssssttttaaaarrrrtttt____ppppeeeessss routine identifies the number of processes for a
program. This statement must be the first statement in a program that
uses distributed, shared memory (SHMEM) communication routines. The
ssssttttaaaarrrrtttt____ppppeeeessss routine accepts the following argument:
_n_p_e_s Identifies the total number of processing elements (PEs)
desired. If _n_p_e_s is 0, the number of PEs is selected by the
NNNNPPPPEEEESSSS environment variable. The type of NNNNPPPPEEEESSSS is default
integer.
If your parallel application uses MPI and SHMEM, you can omit the
ssssttttaaaarrrrtttt____ppppeeeessss call and call MMMMPPPPIIII____IIIInnnniiiitttt and MMMMPPPPIIII____FFFFiiiinnnnaaaalllliiiizzzzeeee, as specified in the
MPI standard, and launch the program with the mmmmppppiiiirrrruuuunnnn command. Do not
call both MMMMPPPPIIII____iiiinnnniiiitttt and ssssttttaaaarrrrtttt____ppppeeeessss from the same program.
Programs that use both SHMEM and MPI must call MMMMPPPPIIII____IIIInnnniiiitttt and
MMMMPPPPIIII____FFFFiiiinnnnaaaalllliiiizzzzeeee instead of ssssttttaaaarrrrtttt____ppppeeeessss. PVM and SHMEM communication cannot
be used in the same program.
For an overview of programming with SHMEM communication routines,
example SHMEM programs, and instructions for compiling SHMEM programs,
see the iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3) man page.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
This is a simple program that calls sssshhhhmmmmeeeemmmm____iiiinnnntttteeeeggggeeeerrrr____ppppuuuutttt(3):
PROGRAM PUT
INTEGER TARG, SRC, RECEIVER, BAR
COMMON /T/ TARG
PARAMETER (RECEIVER=1)
CALL START_PES(0)
IF (MY_PE() .EQ. 0) THEN
SRC = 33
CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
ENDIF
CALL SHMEM_BARRIER_ALL ! SYNCHRONIZES SENDER AND RECEIVER
IF (MY_PE() .EQ. RECEIVER) THEN
CALL SHMEM_UDCFLUSH() ! NEEDED ON CRAY T90 SYSTEMS
PRINT*,'PE ', MY_PE(),' TARG=',TARG
IF (TARG.NE.33) PRINT*,'FAIL'
ENDIF
END
NNNNOOOOTTTTEEEESSSS
If the ssssttttaaaarrrrtttt____ppppeeeessss call is not the first statement in a program,
unexpected results will occur. Static data areas initialized prior to
the ssssttttaaaarrrrtttt____ppppeeeessss call will sometimes be set to zero during ssssttttaaaarrrrtttt____ppppeeeessss